﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace Cms.Utilities
{
    public abstract class DateTimeProvider
    {
        private static DateTimeProvider _current = DefaultDateTimeProvider.Instance;

        public static DateTimeProvider Current
        {
            get { return _current; }
            set
            {
                if (value == null)
                {
                    throw new ArgumentNullException("value");
                }
                _current = value;
            }
        }

        public abstract DateTime Now { get; }

        public static void ResetToDefaultDateTimeProvider()
        {
            _current = DefaultDateTimeProvider.Instance;
        }
    }
}
